Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

properties-parser

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

properties-parser

A parser for .properties files written in javascript

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is properties-parser?

The properties-parser npm package is a utility for parsing and manipulating .properties files, which are commonly used for configuration in Java applications. It allows you to read, write, and modify properties files in a straightforward manner.

What are properties-parser's main functionalities?

Reading Properties

This feature allows you to read a .properties file and parse its contents into a JavaScript object. The example reads a file named 'config.properties' and logs the parsed properties to the console.

const propertiesParser = require('properties-parser');
const properties = propertiesParser.read('config.properties');
console.log(properties);

Writing Properties

This feature allows you to write a JavaScript object to a .properties file. The example writes an object with two key-value pairs to a file named 'config.properties'.

const propertiesParser = require('properties-parser');
const properties = { key1: 'value1', key2: 'value2' };
propertiesParser.write('config.properties', properties);

Modifying Properties

This feature allows you to modify an existing .properties file by reading it, updating the properties, and writing it back. The example reads 'config.properties', adds a new key-value pair, and writes the updated properties back to the file.

const propertiesParser = require('properties-parser');
let properties = propertiesParser.read('config.properties');
properties.key3 = 'value3';
propertiesParser.write('config.properties', properties);

Other packages similar to properties-parser

Keywords

FAQs

Package last updated on 19 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc